import React from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import QuestionnaireHome from "../screens/questionnaire/QuestionnaireHome";
import QuesOptions from "../screens/questionnaire/userQues/QuesOptions";
import AddQuestionnaire from "../screens/questionnaire/AddQuestionnaire";
import QuesType from "../screens/questionnaire/QuesType";
import QuesGroup from "../screens/questionnaire/QuesGroup";
import AddProblem from "../screens/questionnaire/AddProblem";
import ComplexQues from "../screens/questionnaire/ComplexQues";
import Opinions from "../screens/questionnaire/Opinions";
import CompleteQues from "../screens/questionnaire/userQues/CompleteQues";
import PlanSpeed from "../screens/questionnaire/PlanSpeed";
import PlanSpeedAuditor from "../screens/questionnaire/PlanSpeedAuditor";
import ShowFileScreen from "../screens/questionnaire/ShowFileScreen";
import CompleteProblem from "../screens/questionnaire/userQues/CompleteProblem";
import { QuestionnaireProvider } from "../context/questionnaire/QuestionnaireContext";
import { ProblemProvider } from "../context/questionnaire/ProblemContext";
import { OpinionsProvider } from "../context/questionnaire/OpinionsContext";
import { UserQuesProvider } from "../context/questionnaire/UserQuesContext";
import { MyQuesProvider } from "../context/questionnaire/MyQuesContext";
import { UserProblemProvider } from "../context/questionnaire/UserProblem";
import { SpeedProvider } from "../context/questionnaire/SpeedContext";
import { Feather } from "@expo/vector-icons";
const Stack = createNativeStackNavigator();

const QuestionnaireNavigation = ({ navigation }) => {
  return (
    <QuestionnaireProvider>
      <UserProblemProvider>
        <ProblemProvider>
          <OpinionsProvider>
            <UserQuesProvider>
              <MyQuesProvider>
                <SpeedProvider>
                  <Stack.Navigator
                    initialRouteName="Questionnaire"
                    screenOptions={{
                      headerTitleAlign: "center",
                      headerTintColor: "#fff",
                      headerStyle: {
                        backgroundColor: "#A80108",
                      },
                    }}
                  >
                    <Stack.Screen
                      name="问卷填写"
                      component={QuestionnaireHome}
                      options={{
                        headerShown: true,
                        headerLeft: () => (
                          <Feather
                            name="user"
                            style={{ padding: 5 }}
                            size={25}
                            color="#fff"
                            onPress={() => navigation.openDrawer()}
                          />
                        ),
                      }}
                    />
                    <Stack.Screen
                      name="问卷"
                      component={QuesOptions}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="问卷修改"
                      component={AddQuestionnaire}

                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="添加题目"
                      component={QuesType}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="添加题目组"
                      component={QuesGroup}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="AdminProblem"
                      component={AddProblem}
                      options={{ title: "问题清单" }}
                    />
                    <Stack.Screen
                      name="复合题型"
                      component={ComplexQues}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="意见反馈"
                      component={Opinions}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="填写问卷"
                      component={CompleteQues}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="进度报告"
                      component={PlanSpeed}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="PlanSpeedAuditor"
                      component={PlanSpeedAuditor}
                      options={{
                        headerShown: true,
                        title: "进度报告",
                      }}
                    />
                    <Stack.Screen
                      name="入户资料"
                      component={ShowFileScreen}
                      // options={{ headerShown: false }}
                    />
                    <Stack.Screen
                      name="问题清单"
                      component={CompleteProblem}
                      // options={{ headerShown: false }}
                    />
                  </Stack.Navigator>
                </SpeedProvider>
              </MyQuesProvider>
            </UserQuesProvider>
          </OpinionsProvider>
        </ProblemProvider>
      </UserProblemProvider>
    </QuestionnaireProvider>
  );
};

export default QuestionnaireNavigation;
